package cn.hc.sp02.item.service;

import lombok.extern.slf4j.Slf4j;
import org.springframework.stereotype.Service;
import sp01.pojo.Item;
import sp01.service.ItemService;

import java.util.ArrayList;
import java.util.List;

/**
 * @author 海绵宝宝
 * date 2021/10/26 16:28
 */
@Service
@Slf4j
public class itemServiceImpl implements ItemService {

    @Override
    public List<Item> getItems(String OrderId) {
        List<Item> list = new ArrayList<>();
        list.add(new Item(1,"商品1",21));
        list.add(new Item(2,"商品2",8));
        list.add(new Item(3,"商品3",11));
        list.add(new Item(4,"商品4",12));
        list.add(new Item(5,"商品5",42));
        list.add(new Item(6,"商品6",32));
        list.add(new Item(7,"商品7",44));
        return list;
    }

    @Override
    public void decreaseNumbers(List<Item> list) {
        for(Item item : list){
            log.info("减少商品库存："+item);
        }
    }
}
